home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / US Robotics Courier HST.CCL < prev    next >
Encoding:
Text File  |  1992-09-18  |  20.4 KB  |  636 lines  |  [TEXT/MPS ]

  1. !
  2. ! US Robotics Courier HST 9600 baud CCL script (Hardware MNP)
  3. !
  4. !    Change History-
  5. !        v1.0.2        1/15/91        gs:Created CCL
  6. !
  7. !    The following label ranges (0-255) are defined for all scripts:
  8. !
  9. !    Label        Function
  10. !    -----        --------
  11. !    0-19        Communications Setup
  12. !    20-39        Get a Modem (IBX switch thru)
  13. !    40-59        Modem Setup
  14. !    60-79        Dialing
  15. !    80-99        Physical Connection
  16. !    100-119        GEIS Logon
  17. !    120-139        CICS
  18. !    140-159        APPM
  19. !    160-179        Online
  20. !    180-199        Terminate Session
  21. !    200-209        Cancel
  22. !    210-219        Hangup
  23. !    230-239        <UNUSED>
  24. !    240-255        Disconnect
  25. !
  26. !    Note:        Label 210 is the modem hangup sequence
  27. !                Label 240 is reserved as the start of the disconnect sequence
  28. !
  29. !================================================================================
  30. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  31. !================================================================================
  32. !
  33. !    Set the Baud, Data, Stop, and Parity bits
  34. SerReset ~Baud ~Prty ~Xbts ~Sbts
  35. CTBParameter Port "~MPrt" 13
  36. !
  37. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  38. CTBOpen 14 15        ! Open the Communications session
  39. !
  40. !    Flush any data, Initialize script variables and define Cancel label
  41. Flush                ! clear input buffer and ring buffer
  42. CanBtn 200            ! If user cancels, take the error return
  43. !
  44. SetVar 1 0            ! #of consecutive no responses to hangup command
  45. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  46. SetVar 3 0            ! #of consecutive network contact failures.
  47. SetVar 4 0            ! #of logon validation failures
  48. SetVar 5 0            ! #of consecutive CICS90  failures
  49. SetVar 6 0            ! #of consecutive APPM failures
  50. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  51. SetVar 8 0            ! not used
  52. !
  53. Jump 20                ! Go to Modem Selection and Setup
  54. !
  55. !*********
  56. -LABEL 13    !---<CTBParameter Port failed>---
  57. !*********
  58. Alert -1 CTBParameter Port caused an error.
  59. Exit -1                ! exit the script with an error.
  60. !
  61. !*********
  62. -LABEL 14    !---<CTBOpen failed>---
  63. !*********
  64. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  65. Exit -1                ! exit the script with an error.
  66. !
  67. !**********
  68. -LABEL 15    !---<CTBOpen err>---
  69. !**********
  70. Alert -1 CTBOpen caused an Communications Toolbox error.
  71. Exit -1                ! exit the script with an error.
  72. !
  73. !================================================================================
  74. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  75. !================================================================================
  76. !
  77. !================================================================================
  78. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  79. !================================================================================
  80. DsplyPic 1
  81. DsplyMsg Making sure the modem is ready.
  82. Jsr 210                ! Hang up (just in case)
  83. SetVar 1 0            ! clear # hangup tries counter
  84. !
  85. !**********
  86. -LABEL 42    ! ---<Got modem attention>---
  87. !**********
  88. DsplyMsg Setting modem parameters.
  89. !    Clear all previous MatchStr's and setup the modem
  90. MatchStr 1 42 Dummy
  91. Wait 30                ! Give modem .5 second to get ready before sending the attention chars
  92. !    Send US Robotics Courier HST MNP Compatible modem commands
  93. !    V1 = verbose, &i2 = Xon/Xoff, &H2 = use s/w flow control,
  94. !    &A3 = return extended result codes, X6 = get all result codes
  95. Xmit ATV1&i2&H2&M5&A3X6
  96. Wait 3
  97. Flush                ! clear input buffer and send Carriage Return (CR)
  98. Xmit \13
  99. !
  100. !    Look for one of the following expected responses
  101. MatchStr 1 60 OK
  102. Wait 180               ! wait 3 secs
  103. IncVar 2            ! increment # modem setup tries
  104. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  105. DsplyMsg Modem does not respond to setup commands. Retrying ...
  106. Jump 42                ! else try modem setup again
  107. !
  108. !**********
  109. -LABEL 44    ! ---<Modem configuration err>---
  110. !**********
  111. Bell
  112. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  113. SetVar 2 0            ! clear # modem setup tries
  114. Jump 40                ! reset modem and try again
  115. !
  116. !================================================================================
  117. -LABEL 60    !***<Modem ready>*** Dial phone
  118. !================================================================================
  119. DsplyMsg Dialing ~Fone ...
  120. DsplyPic 2
  121. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  122. MatchStr 1 60 Dummy
  123. SetVar 2 0            ! clear #modem setup tries
  124. !    Turn off Xon/Xoff flow control
  125. CTBParameter Handshake XON/XOFF 78
  126. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  127. Xmit AT
  128. Wait 3                ! Pause before "tone dial" command
  129. Xmit D~Tone
  130. Wait 3                ! Pause before phone number
  131. Xmit ~Fone
  132. Wait 3
  133. Flush                ! clear input buffer and send CR
  134. Xmit \13
  135. !
  136. !    Look for one of the following expected responses
  137. MatchStr 1 80 MNP\13
  138. MatchStr 2 66 CARRIER
  139. MatchStr 3 70 BUSY
  140. MatchStr 4 74 NO DIAL
  141. MatchStr 5 62 ERROR
  142. Wait 2100            ! wait 35 secs
  143. !
  144. !**********
  145. -LABEL 62    !---<No response or ERROR from modem>---
  146. !**********
  147. IncVar 3            ! Increment # dial attempts counter
  148. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  149. DsplyMsg Modem does not respond to Dial command. Retrying ...
  150. Jump 40                ! reset modem and try again
  151. !
  152. !**********
  153. -LABEL 64    !---<No dial response err>---
  154. !**********
  155. Bell
  156. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  157. SetVar 3 0            ! clear # dial attempts counter
  158. Jump 40                ! reset modem and try again
  159. !
  160. !**********
  161. -LABEL 66   !---<No Carrier>---
  162. !**********
  163. IncVar 3            ! Increment # dial attempts counter
  164. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  165. DsplyMsg No Carrier with phone number dialed. Retrying ...
  166. Jump 40                ! reset modem and try again
  167. !
  168. !**********
  169. -LABEL 68    !---<No carrier err>---
  170. !**********
  171. Bell
  172. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  173. SetVar 3 0            ! clear # dial attempts counter
  174. Jump 40                ! reset modem and try again
  175. !
  176. !**********
  177. -LABEL 70    !---<busy>---
  178. !**********
  179. IncVar 3            ! Increment # dial attempts counter
  180. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  181. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  182. Wait 300            ! wait 5 secs
  183. DsplyMsg Phone number dialed is busy. Retrying ....
  184. Jump 40                ! reset modem and try again
  185. !
  186. !**********
  187. -LABEL 72    !---<Busy err>---
  188. !**********
  189. Bell
  190. Alert 200 All network access lines are in use.\13Try again later.
  191. SetVar 3 0            ! clear # dial attempts counter
  192. Jump 40                ! reset modem and try again
  193. !
  194. !**********
  195. -LABEL 74    !---<No Dialtone>---
  196. !**********
  197. IncVar 3            ! Increment # dial attempts counter
  198. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  199. DsplyMsg Modem reports no dial tone. Retrying ...
  200. Jump 40                ! reset modem and try again
  201. !
  202. !**********
  203. -LABEL 76   !---<No dialtone Error>---
  204. !**********
  205. Bell
  206. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  207. SetVar 3 0            ! clear # dial attempts counter
  208. Jump 40                ! reset modem and try again
  209. !
  210. !*********
  211. -LABEL 78    !---<CTBParameter XON/XOFF failed>---
  212. !*********
  213. Alert -1 CTBParameter XON/XOFF caused an error.
  214. Exit -1                ! exit the script with an error
  215. !
  216. !================================================================================
  217. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  218. !================================================================================
  219. DsplyMsg Requesting network attention
  220. !    Look for one of the following expected responses
  221. MatchStr 1 84 NO CARRIER
  222. MatchStr 2 100 U#
  223. Wait 12                ! Wait 0.2 sec before sending the first H
  224. Xmit H
  225. Wait 21                ! Wait another 0.35 sec before sending the second H
  226. Xmit H
  227. Wait 600            ! Allow 10 seconds for the U# to show up
  228. IncVar 3            ! No U#, increment # dial attempts counter
  229. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  230. DsplyMsg Unable to get network attention. Retrying ...
  231. Jump 40                ! reset modem and try again
  232. !
  233. !**********
  234. -LABEL 82    !---<No U#>---
  235. !**********
  236. Bell
  237. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  238. SetVar 3 0            ! clear # dial attempts counter
  239. Jump 40                ! reset modem and try again
  240. !
  241. !**********
  242. -LABEL 84    !---<Line dropped>---
  243. !**********
  244. IncVar 3            ! Increment # dial attempts counter
  245. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  246. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  247. Jump 40                ! reset modem and try again
  248. !
  249. !**********
  250. -LABEL 86   !---<Line dropped Err>---
  251. !**********
  252. Bell
  253. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  254. SetVar 3 0            ! clear # dial attempts counter
  255. Jump 40                ! reset modem and try again
  256. !
  257. !================================================================================
  258. -LABEL 100    !***<GEIS logon>***
  259. !================================================================================
  260. !
  261. DsplyMsg Physical Connection established. Logging on to network ...
  262. DsplyPic 3
  263. SetVar 3 0            ! clear # dial attempts counter
  264. Wait 6                ! wait 0.1 sec
  265. Flush                ! clear input buffer
  266. !    Note: leave 2 spaces between ~Dist and ~Numb
  267. Xmit ~User,~Dist  ~Numb,~Ridn\13
  268. !
  269. !    Look for one of the following expected responses
  270. MatchStr 1 104 NO CARRIER
  271. MatchStr 2 106 DISCONNECTED
  272. MatchStr 3 120 ===>
  273. MatchStr 6 108 N FAULT,
  274. MatchStr 7 108 T FORMAT,
  275. MatchStr 8 110 L DENIED
  276. MatchStr 9 112 BUSY
  277. MatchStr 10 112 DOWN
  278. Wait 4200            ! wait up to 70 seconds for a response
  279. IncVar 4            ! Increment # logon attempts counter
  280. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  281. DsplyMsg No logon response from network. Retrying ...
  282. Jump 40                ! reset modem and try again
  283. !
  284. !*********
  285. -LABEL 102    !---<No Logon response>---
  286. !*********
  287. Bell
  288. Alert 200 No logon response from network.\13Try again.
  289. SetVar 4 0            ! clear # logon attempts counter
  290. Jump 40                ! reset modem and try again
  291. !
  292. !*********
  293. -LABEL 104    !---<Carrier dropped>---
  294. !*********
  295. IncVar 4            ! Increment # login attempts counter
  296. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  297. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  298. Jump 40                ! reset modem and try again
  299. !
  300. !*********
  301. -LABEL 105    !---<Carrier dropped Err>---
  302. !*********
  303. Bell
  304. Alert 200 Carrier signal dropped during network logon.\13Try again.
  305. SetVar 4 0            ! clear # logon attempts counter
  306. Jump 40                ! reset modem and try again
  307. !
  308. !*********
  309. -LABEL 106    !---<Session disconnected>---
  310. !*********
  311. IncVar 4            ! Increment # logon attempts counter
  312. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  313. DsplyMsg Network connection dropped during network logon. Retrying ...
  314. Jump 40                ! reset modem and try again
  315. !
  316. !*********
  317. -LABEL 107    !---<Session disconnected Err>---
  318. !*********
  319. Bell
  320. Alert 200 Network connection dropped during network logon.\13Try again.
  321. SetVar 4 0            ! clear # logon attempts counter
  322. Jump 40                ! reset modem and try again
  323. !
  324. !*********
  325. -LABEL 108    !---<Validation fault>---
  326. !*********
  327. IncVar 4            ! Increment # logon attempts counter
  328. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  329. DsplyMsg Network rejected your identification. Retrying ...
  330. Wait 60                ! wait 1 sec
  331. Jump 100            ! retry GEIS login (only case where we don't reset)
  332. !
  333. !*********
  334. -LABEL 109    !---<validation fault err>---
  335. !*********
  336. Bell
  337. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  338. SetVar 4 0            ! clear # logon attempts counter
  339. Jump 40                ! reset modem and try again
  340. !
  341. !*********
  342. -LABEL 110    !---<Denied by host>---
  343. !*********
  344. IncVar 4            ! Increment # logon attempts counter
  345. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  346. DsplyMsg Network host equipment problem detected. Retrying ...
  347. Jump 40                ! reset modem and try again
  348. !
  349. !*********
  350. -LABEL 111    !---<Denied by host err>---
  351. !*********
  352. Bell
  353. Alert 200 Network host equipment problem detected.\13Try again.
  354. SetVar 4 0            ! clear # logon attempts counter
  355. Jump 40                ! reset modem and try again
  356. !
  357. !*********
  358. -LABEL 112    !---<MARK3K access busy/down>---
  359. !*********
  360. IncVar 4            ! Increment # logon attempts counter
  361. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  362. DsplyMsg Network equipment busy/down. Retrying ...
  363. Jump 40                ! reset modem and try again
  364. !
  365. !*********
  366. -LABEL 113    !---<MARK3K access busy/down err>---
  367. !*********
  368. Bell
  369. Alert 200 Network equipment busy or down.\13Try again.
  370. SetVar 4 0            ! clear # logon attempts counter
  371. Jump 40                ! reset modem and try again
  372. !
  373. !================================================================================
  374. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  375. !================================================================================
  376. !
  377. DsplyMsg Requesting access to network subsystem ...
  378. DsplyPic 4
  379. Wait 6                ! wait 0.1 secs
  380. Flush                ! clear input buffer
  381. !
  382. Xmit ~CICS\13
  383. !    Look for one of the following expected responses
  384. MatchStr 3 140 READY
  385. !    To overcome a network problem, the following label was changed from 124 to 126
  386. !    MatchStr 4 124 T BOUND
  387. MatchStr 4 126 T BOUND
  388. MatchStr 5 126 UNRECOGN
  389. MatchStr 6 126 ===>
  390. Wait 3600            ! Allow 60 secs for the expected responses to show up
  391. IncVar 5            ! Timeout, so increment # CICS tries counter
  392. IfVar 5 2 122        ! if 3 tries, display No Response alert
  393. DsplyMsg No response to network subsystem request. Retrying ...
  394. Jump 40                ! reset modem and try again
  395. !
  396. !*********
  397. -LABEL 122    !---<No CICS err>---
  398. !*********
  399. Bell
  400. Alert 200 No response to network subsystem request.\13Try again.
  401. SetVar 5 0            ! clear # CICS tries counter
  402. Jump 40                ! reset modem and try again
  403. !
  404. !*********
  405. -LABEL 124    !---<Session not bound err>---
  406. !*********
  407. Bell
  408. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  409. Jump 200            ! jump to cancel routine
  410. !
  411. !*********
  412. -LABEL 126    !---<Invalid application>---
  413. !*********
  414. IncVar 5            ! Increment # CICS tries counter
  415. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  416. DsplyMsg Network subsystem request has been rejected. Retrying ...
  417. Wait 60                ! wait 1 sec
  418. Flush
  419. Jump 120            ! try to access CICS again
  420. !
  421. !*********
  422. -LABEL 127    !---<Invalid application err>---
  423. !*********
  424. Bell
  425. Alert 200 The network subsystem request has been rejected.\13Try again.
  426. SetVar 5 0            ! clear # CICS tries counter
  427. Flush
  428. Jump 40                ! reset modem and try again
  429. !
  430. !================================================================================
  431. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  432. !================================================================================
  433. !
  434. DsplyMsg Requesting access to distribution center ~Dist ...
  435. DsplyPic 5            ! Highlight box 5 on screen
  436. SetVar 5 0            ! clear # CICS tries counter
  437. !                    ! Send what needs to be sent
  438. Xmit ~Epgm~Dist\13
  439. !    Look for one of the following expected responses
  440. Wait 12                ! wait 0.2 secs
  441. Flush                ! clear input buffer
  442. !    Look for one of the following expected responses
  443. MatchStr 3 160 C100
  444. MatchStr 4 144 INVALID
  445. Wait 3600            ! Allow 60 secs for the expected responses to show up
  446. !
  447. IncVar 6            ! Timeout, so Increment # APPM tries counter
  448. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  449. DsplyMsg No response to distribution center access request. Retrying ...
  450. Jump 40                ! reset modem and try again
  451. !
  452. !*********
  453. -LABEL 142    !---<No transaction response>---
  454. !*********
  455. Bell
  456. Alert 200 No response to distribution center access.\13Try again.
  457. SetVar 6 0            ! reset # APPM tries counter
  458. Jump 40                ! reset modem and try again
  459. !
  460. !*********
  461. -LABEL 144    !---<Invalid transaction>---
  462. !*********
  463. IncVar 6            ! Increment # APPM tries counter
  464. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  465. DsplyMsg Distribution center access request rejected. Retrying ...
  466. Jump 40                ! reset modem and try again
  467. !
  468. !*********
  469. -LABEL 145    !---<Invalid transaction err>---
  470. !*********
  471. Bell
  472. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  473. SetVar 6 0            ! reset # APPM tries counter
  474. Jump 40                ! reset modem and try again
  475. !
  476. !================================================================================
  477. -LABEL 160    !***<Online>***
  478. !================================================================================
  479. !
  480. Wait 60                ! wait 1 sec
  481. DsplyMsg Accessing the distribution center ~Dist ...
  482. DsplyPic 6            ! Highlight box 6 on screen
  483. !    C9 = pass msg thru GE, 899 = Echo cmd
  484. Xmit C9899Ole\13
  485. !    Look for one of the following expected responses
  486. MatchStr 2 162 C5
  487. MatchStr 3 170 Ole\13
  488. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  489. !
  490. !*********
  491. -LABEL 162    !---<no luck this time>--- 
  492. !*********
  493. DsplyMsg Distribution center is not available ...
  494. Jsr 180                ! terminate session
  495. Bell
  496. Alert -1 Distribution center is not available.\13Please try again later.
  497. Jump 200            ! exit to Cancel routine
  498. !
  499. !*********
  500. -LABEL 170    !---<Success, we’re in, so exit>--- 
  501. !*********
  502. Wait 30                ! wait 0.5 secs
  503. Flush                ! clear input buffer
  504. Exit 0                ! exit the script normally
  505. !
  506. !================================================================================
  507. -LABEL 180-199    !***<Terminate Session>***
  508. !================================================================================
  509. !
  510. !*********
  511. -LABEL 180    !---<Terminate session>--- 
  512. !*********
  513. !    send Abnormal disconnect command
  514. Xmit C3\13
  515. !    Look for one of the following expected responses
  516. MatchStr 1 182 U#
  517. Wait 300            ! wait 5 secs
  518. Return
  519. !
  520. !*********
  521. -LABEL 182    !---<Say bye>---
  522. !*********
  523. Wait 6                ! wait 0.1 sec and sign off the network
  524. Xmit BYE\13
  525. Return
  526. !
  527. !================================================================================
  528. -LABEL 200    !***<Cancel Routine>***
  529. !================================================================================
  530. DsplyMsg Canceling ...
  531. Flush
  532. Wait 30                ! wait 0.5 secs
  533. Exit -1                ! exit the script with an error
  534. !
  535. !================================================================================
  536. -LABEL 210    !***<Hang up phone Routine>***
  537. !================================================================================
  538. !
  539. !    Look for one of the following expected responses
  540. MatchStr 1 222 CARRIER
  541. SetVar 1 0            ! clear # hangup tries counter
  542. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  543. !
  544. !*********
  545. -LABEL 220    !---<Hang up the phone subroutine>---
  546. !*********
  547. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  548. Xmit +
  549. Xmit +
  550. Xmit +
  551. Wait 60                ! wait 1 more sec (end guard time)
  552. Flush                ! clear input buffer and tell modem to hang up verbosely
  553. Xmit ATV1H\13
  554. !    Look for one of the following expected responses
  555. MatchStr 2 222 OK
  556. MatchStr 3 224 ERROR
  557. Wait 120            ! wait 2 secs
  558. Jump 224            ! test for error or no response            
  559. !
  560. !*********
  561. -LABEL 222    !---<Reset the modem>---
  562. !*********
  563. !
  564. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  565. !                      This aids in script debugging so we dont reset modem 1st time.
  566. Flush                ! Flush the buffer and send Hayes Reset Modem command
  567. Xmit ATZ\13
  568. !    Look for one of the following expected responses
  569. MatchStr 2 229 OK
  570. MatchStr 3 224 ERROR
  571. Wait 180            ! wait 3 secs
  572. !
  573. !*********
  574. -LABEL 224    !---<Error or just no response>---
  575. !*********
  576. IncVar 1            ! Increment # hangup tries counter
  577. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  578. Jump 220            ! try to hangup again
  579. !
  580. !*********
  581. -LABEL 225    !---<Error>---
  582. !*********
  583. IfVar 7 1 229        ! If disconnecting, just return.
  584. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  585. SetVar 1 0            ! clear # hangup tries counter
  586. Jump 220            ! try to hangup again
  587. !
  588. !*********
  589. -LABEL 229    !---<Return from the Hangup sequence>---
  590. !*********
  591. Wait 60                ! wait 1 sec
  592. Flush                ! clear input buffer
  593. Return
  594. !
  595. !================================================================================
  596. -LABEL 230-239    !***<UNUSED>***
  597. !================================================================================
  598. !
  599. !================================================================================
  600. -LABEL 240    !***<Disconnection Sequence>***
  601. !================================================================================
  602. !
  603. !    If the connection is closed, we cant hangup, so just exit
  604. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  605. CTBIFCLOSED 246
  606. !
  607. SetVar 7 1            ! We're disconnecting, so set the flag
  608. !    Look for one of the following expected responses
  609. MatchStr 1 242 U#
  610. MatchStr 2 244 NO CARRIER
  611. Wait 60                ! wait 1 sec
  612. Jump 244            ! and hang up the phone
  613. !
  614. !*********
  615. -LABEL 242    !---<Sign off the network>---
  616. !*********
  617. Xmit BYE\13
  618. Wait 120            ! wait 2 secs
  619. !
  620. !*********
  621. -LABEL 244    !---<Hang up the phone>---
  622. !*********
  623. SetVar 1 0            ! clear the # hangup tries counter
  624. Jsr 210                ! Execute the Hang-up subroutine
  625. !    No CTBClose here because the connection is closed externally from the script
  626. !    in case we exited the script with an error before completion.
  627. Flush                ! clear input buffer
  628. Exit 0                ! exit the script normally
  629. !
  630. !*********
  631. -LABEL 246    !---<Connection Was Closed>---
  632. !*********
  633. Flush                ! clear input buffer
  634. Exit 0                ! exit the script normally
  635. ###
  636.